import numpy as np

if __name__ == '__main__':
    # 单位矩阵为方阵的时候，对角线上元素均为1
    matrix_1 = np.eye(3)
    print(matrix_1)

    # 单位矩阵不是方阵，最后一行/最后一列元素均为0
    matrix_2 = np.eye(3, 4)
    print(matrix_2)

    matrix_3 = np.eye(4, 3)
    print(matrix_3)

